package com.njym.java.security.app.rpc;

import com.njym.java.security.api.vo.user.AppUserInfo;
import com.njym.java.security.app.rpc.service.PermissionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.Map;

/**
 * ${DESCRIPTION}
 *
 * @author wanghaobin
 * @create 2017-06-21 8:15
 */
@RestController
@RequestMapping("api")
public class UserRest {
    @Autowired
    private PermissionService permissionService;


    @RequestMapping(value = "/appuser/validate", method = RequestMethod.POST)
    public @ResponseBody
    AppUserInfo validate(@RequestBody Map<String,String> body){
        return permissionService.validate(body.get("username"),body.get("password"));
    }

}
